package org.djustice.apkgot;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class PackageItemView extends LinearLayout {

    private TextView mText;
    private ImageView mIcon;

    public PackageItemView(Context context, PackageItem aIconifiedText) {
	super(context);

	this.setOrientation(HORIZONTAL);

	mIcon = new ImageView(context);
	mIcon.setImageDrawable(aIconifiedText.getIcon());

	mIcon.setPadding(0, 2, 5, 0);

	addView(mIcon,  new LinearLayout.LayoutParams(
		LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

	mText = new TextView(context);
	mText.setText(aIconifiedText.getText());

	addView(mText, new LinearLayout.LayoutParams(
		LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    }

    public void setText(String words) {
	mText.setText(words);
    }

    public void setIcon(Drawable d) {
	mIcon.setImageDrawable(d);
    }
}
